<script type="text/javascript">
    
            function addCommas(nStr)
            {
                    nStr += '';
                    x = nStr.split('.');
                    x1 = x[0];
                    x2 = x.length > 1 ? '.' + x[1] : '';
                    var rgx = /(\d+)(\d{3})/;
                    while (rgx.test(x1)) {
                            x1 = x1.replace(rgx, '$1' + ',' + '$2');
                    }
                    return x1 + x2;
            }

            formatMoney = function(value) {
                    value = parseFloat(value);
                    if (value > 100) {
                            value = value.toFixed(-2);
                    }                     
                    return addCommas(value);
                    //return isNaN(value) ? '...' : '$' + parseFloat(value).toFixed(2);
            }
                
            gridLayout = {
                    defaultCell: { width: 8, editable: true, styles: 'text-align: right;'  },
                    cells: [
                            { name: 'Id', width: 3, field: 'id', styles: 'text-align: center;' },
                            { name: 'Title', field: 'title', styles: '', width: '100%', editable:true },
                            { name: 'Test2', field: 'test2_id', styles: 'text-align: left;', type: dojox.grid.cells.Select, store:'test2_id_0_store'},  
                            { name: 'Test4', field: 'test4'},
                            { name: 'Status', field: 'status', width: 3, styles: 'text-align: center;', type: dojox.grid.cells.Bool  },                                                        
                            { name: 'Price(VND)', field: 'price', formatter: formatMoney}
                    ]
            };
	</script>


<div data-dojo-id="grid_0_store" data-dojo-type="dojo.data.ItemFileReadStore" data-dojo-props='url:"<?php echo $ajax_link . '/get_store_grid/'?>"'></div>        

	<div id="grid" jsId="grid" dojoType="dojox.grid.DataGrid" query="{ id: '*' }"
		 rowsPerPage="20" store="grid_0_store" structure="gridLayout" rowSelector="20px">
	</div>    